package com.dup.jxlh.api.enums;

public enum ChapterApplyTypeEnum {
    CONTRACT(1, "合同用章"),
    PROJECT(2, "项目用章"),
    REPORT(3, "报告用章"),
    FINANCE(4, "财务用章"),
    OTHER(9, "其他");

    private Integer code;
    private String name;

    ChapterApplyTypeEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public static String getNameByCode(Integer code) {
        for (ChapterApplyTypeEnum stateEnum: values()){
            if(stateEnum.getCode() == code){
                return stateEnum.getName();
            }
        }
        return null;
    }

    public Integer getCode() {
        return code;
    }

    public String getName() {
        return name;
    }
}
